﻿using System;
using System.Drawing;

namespace System
{
	public partial class Math3DWin32
	{
		public static void DrawGraphics(this V3D P, Graphics G, Brush B, double Size)
		{
			if (Size > 0)
				G.FillRectangle(B, (float)(P.X - Size), (float)(P.Y - Size), (float)Size * 2, (float)Size * 2);
		}

		public static void DrawLines(Graphics G, Pen P, params V3D[] Points)
		{
			if (Points.Length > 1)
			{
				PointF[] X = Array.ConvertAll(Points, lambda => lambda.ToPointF());
				G.DrawPolygon(P, X);
			}
		}
		public static Pen ToPen(this V3D P, double Width)
		{
			return new Pen(Color.FromArgb((int)P.X, (int)P.Y, (int)P.Z), (float)Width);
		}

		public static void DrawPolygon(Graphics G, Brush B, params V3D[] Points)
		{
			if (Points.Length > 1)
			{
				PointF[] X = Array.ConvertAll(Points, lambda => lambda.ToPointF());
				G.FillPolygon(B, X);
			}
		}
	}
}